<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script>
    const obj = {
      name: "why",
      age: 18,
      height: 1.88
    }

    Object.defineProperty(obj, "name", {
      configurable: false
    })

    Reflect.defineProperty(obj, "name", {
      configurable: false
    })

    // 1.以前的操作
    delete obj.name
    if(obj.name){
      console.log("name属性存在")
    }else{
      console.log("name属性不存在")
    }
    // 2.Reflect
    if(Reflect.deleteProperty(obj, "name")){
      console.log("name删除成功")
    }else{
      console.log("name没有删除成功")
    }

  </script>
</body>

</html>